package btree;

public class BubbleSortDemo {
    public static void main(String[] args) {
        int[] arr = new int[] {6, 1, 54, 2, 3};
        sort(arr);

        for (int i : arr) {
            System.out.println(i);
        }
    }

    public static int[] sort(int[] arr) {
        int temp;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr.length - 1- i; j++) {
                if (arr[j] > arr[j + 1]) {
                    temp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = temp;
                }
            }
        }
        return arr;
    }


}
